home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / -archivi / -recent2 / clib37x.lha / CLib37x / source / lib_source / SampleFuncs.c < prev    next >
C/C++ Source or Header  |  1997-12-02  |  2KB  |  53 lines

  1. /*
  2. **      $VER: SampleFuncs.c 37.12 (29.6.97)
  3. **
  4. **      Demo functions for example.library
  5. **
  6. **      (C) Copyright 1996-97 Andreas R. Kleinert
  7. **      All Rights Reserved.
  8. */
  9.  
  10. #define __USE_SYSBASE        // perhaps only recognized by SAS/C
  11.  
  12. #include <exec/types.h>
  13. #include <exec/memory.h>
  14.  
  15. #ifdef __MAXON__
  16. #include <clib/exec_protos.h>
  17. #include <clib/intuition_protos.h>
  18. #else
  19. #include <proto/exec.h>
  20. #include <proto/intuition.h>
  21. #include <intuition/intuition.h>
  22. #endif
  23.  
  24. #include "compiler.h"
  25.  
  26.  /* Please note, that &ExampleBase always resides in register __a6 as well,
  27.     but if we don't need it, we need not reference it here.
  28.  
  29.     Also note, that registers a0, a1, d0, d1 always are scratch registers,
  30.     so you usually should only *pass* parameters there, but make a copy
  31.     directly after entering the function. To avoid problems of kind
  32.     "implementation defined behaviour", you should make a copy of A6 too,
  33.     when it is actually used.
  34.  
  35.     In this example case, scratch register saving would not have been necessary
  36.     (since there are no other function calls inbetween), but we did it nevertheless.
  37.   */
  38.  
  39. ULONG __saveds ASM EXF_TestRequest( register __d1 UBYTE *title_d1 GNUCREG(d1), register __d2 UBYTE *body GNUCREG(d2), register __d3 UBYTE *gadgets GNUCREG(d3))
  40. {
  41.  UBYTE *title = title_d1;
  42.  
  43.  struct EasyStruct __aligned estr;
  44.  
  45.  estr.es_StructSize   = sizeof(struct EasyStruct);
  46.  estr.es_Flags        = NULL;
  47.  estr.es_Title        = title;
  48.  estr.es_TextFormat   = body;
  49.  estr.es_GadgetFormat = gadgets;
  50.  
  51.  return( (ULONG) EasyRequestArgs(NULL, &estr, NULL, NULL));
  52. }
  53.